<?php
namespace modules\game\services\observer;

abstract class ISubject{
	public $_observer = [];

	public function notify(){
		if($this->_observer){
	
			foreach($this->_observer as $observer){
				$observer->play();
				ob_flush();
				flush();
					
			}
			sleep(1);
			
		}
	}

	//注册观察者
	abstract public function attach(IObserver $observer);
	//取消观察者
	abstract public function detach(IObserver $observer);
}